#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main() {
    string r, s;
    cin >> s;
    int flag = 0;
    for (int len = s.size(), i = len - 1; i >= 0; i--)
    {
        if (flag == 3)
        {
            flag = 0;
            r = r + ',';
        }
        r += s[i];
        flag++;
    }
    reverse(r.begin(), r.end());
    cout << r << endl;
}